<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>User Information</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
    <h1>User Information</h1>
    <form action="/add" method="post">
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" required>
        <label for="role">Role:</label>
        <input type="text" id="role" name="role" required>
        <label for="phone">Phone:</label>
        <input type="text" id="phone" name="phone" required>
        <button type="submit">Add User</button>
    </form>
    <table>
        <thead>
            <tr>
                <th>User ID</th>
                <th>Username</th>
                <th>Role</th>
                <th>Phone</th>
                <th>Created At</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            {% for user in users %}
            <tr>
                <td>{{ user.user_id }}</td>
                <td>{{ user.username }}</td>
                <td>{{ user.role }}</td>
                <td>{{ user.phone }}</td>
                <td>{{ user.created_at.strftime('%Y-%m-%d %H:%M:%S') }}</td>
                <td>
                    <a href="{{ url_for('update', user_id=user.user_id) }}">Edit</a>
                    <a href="{{ url_for('delete', user_id=user.user_id) }}">Delete</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</body>
</html>